#include <bits/stdc++.h>
using namespace std;
struct group
{
	int num;
	string mes[10140];
};
group g[10140];

bool check(string s)
{
	if(s.find("bie")!=string::npos)
	{
		return true;
	}
	else
	{
		return false;
	}
}

int main()
{
	int n;
	cin >> n;
	for(int i=1;i<=n;i++)
	{
		cin >> g[i].num;
		for(int j=1;j<=g[i].num;j++)
		{
			cin >> g[i].mes[j];
		}
	}
	set <string> g0;
	for(int i=1;i<=n;i++)
	{
		int count=0;
		for(int j=1;j<=g[i].num;j++)
		{
			if(check(g[i].mes[j])&&g0.find(g[i].mes[j])==g0.end())
			{
				g0.insert(g[i].mes[j]);
				cout << g[i].mes[j] << endl;
				count++;
			}
		}
		if(count==0)
		{
			cout << "Time to play Genshin Impact, Teacher Rice!" << endl;
		}
	}
	return 0;
}
